<?php
/**
 * 原始基类
 * Author: MR.zhou
 * */
namespace app\common\controller;
use think\Controller;
use think\Db;

class Base extends  Controller
{
    function _initialize()
    {
        parent::_initialize();
        echo 1;
    }

    /**
     * 返回ip所在位置
     * */
    public function ip_address($ip=''){
       if (empty($ip)) $ip = request()->ip();
        $info = Model('site')->info();
        if($info['ip_library'] ==1){
            $arr= ip_taobao($ip);
        }else{
            $arr= ip_sina($ip);
        }
        $address = implode(' ',$arr);
        return $address;
    }
}